package com.yankelin.construction.dao;

import org.hibernate.Criteria;
import org.hibernate.criterion.Projections;

import com.yankelin.construction.pojo.Worker;

public class WorkerDao extends BaseDao<Worker,Integer>{

	public int findCount(String columnName){
		Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Worker.class);
		criteria.setProjection(Projections.count(columnName));
		int countRows = Integer.parseInt(criteria.uniqueResult().toString());
		return countRows;
	}
}
